/*
 * Copyright (C) 2013 Susanta
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package coalescent.updatecenter;

import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.awt.HtmlBrowser.URLDisplayer;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle.Messages;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;

@ActionID(
    category       = "Help",
    id             = "coalescent.updatecenter.OpenFeedbackFormAction"
)
@ActionRegistration(displayName = "#CTL_OpenFeedbackFormAction")
@ActionReference(
    path           = "Menu/Help",
    position       = 200,
    separatorAfter = 250
)
@Messages("CTL_OpenFeedbackFormAction=Submit Feedback")
public final class OpenFeedbackFormAction implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {

        try {

            URLDisplayer.getDefault().showURLExternal(
                new URL(
                    "https://docs.google.com/forms/d/15XOSViDji69JOQrzt3dQBCMb6rv3xnlyARaukCCI2Tk/viewform"));

        } catch (MalformedURLException ex) {
            Exceptions.printStackTrace(ex);
        }
    }
}
